package com.pro.service.imple;

import com.pro.mapper.JsBeforeUserMapper;
import com.pro.pojo.JsBeforeUser;
import com.pro.pojo.JsClosure;
import com.pro.pojo.JsUnseal;
import com.pro.service.JsBeforeUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:JsBeforeUserServiceImple
 * Package:com.pro.service.imple
 * Description:
 *
 * @Date:2022/1/21 15:05
 * @Author: XJR
 */
@Service
public class JsBeforeUserServiceImple implements JsBeforeUserService {

    @Autowired
    private JsBeforeUserMapper mapper;

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/21
     * @Content:进思用户人员列表
     */
    public List<JsBeforeUser> selectJsBeforeUser(String userCode, String account, String fullName, String profession,Integer limit,Integer page){
        page = (page-1)*limit;
        List<JsBeforeUser> jsBeforeUsers = mapper.selectJsBeforeUser(userCode, account, fullName, profession,limit,page);
        return jsBeforeUsers;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/21
     * @Content:进思用户人员数量
     */
    public Integer countJsBeforeUser(String userCode,String account,String fullName,String profession){
        Integer integer = mapper.countJsBeforeUser(userCode, account, fullName, profession);
        return integer;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/21
     * @Content:通过id查看信息详情
     */
    public List<JsBeforeUser> selectJsBeforeUserById(Integer userId){
        List<JsBeforeUser> jsBeforeUsers = mapper.selectJsBeforeUserById(userId);
        return jsBeforeUsers;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/21
     * @Content:更改用户毕业状态
     */
    public Boolean beforeUserType(Integer userId,Integer type){
        Boolean tyBoolean = mapper.beforeUserType(userId, type);
        return tyBoolean;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/21
     * @Content:更改用户账号状态
     */
    public Boolean beforeUserAccount(JsClosure jsClosure){
        Boolean statusBoolean = mapper.beforeUserAccount(jsClosure);
        return statusBoolean;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/23
     * @Content:更改封停列表中的数据
     */
    public Boolean updateUserClosure(Integer id,String endDate){
        Boolean aBoolean = mapper.updateUserClosure(id, endDate);
        return aBoolean;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/23
     * @Content:向解封列表中添加数据
     */
    public Boolean insertUserUnseal(JsUnseal jsUnseal){
        Boolean aBoolean = mapper.insertUserUnseal(jsUnseal);
        return aBoolean;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/21
     * @Content:编辑前台用户信息
     */
    public Boolean updateBeforeUser(JsBeforeUser jsBeforeUser){
        Boolean updateBoolean = mapper.updateBeforeUser(jsBeforeUser);
        return updateBoolean;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/21
     * @Content:编辑进思学院用户信息
     */
    public Boolean updateUserDevelopment(JsBeforeUser jsBeforeUser){
        Boolean updateBoolean = mapper.updateUserDevelopment(jsBeforeUser);
        return updateBoolean;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/22
     * @Content:查看非进思用户信息
     */
    public List<JsBeforeUser> selectNoUserBefore(String account,String nickName,String createDate,Integer limit,Integer page){
        page = (page-1)*limit;
        List<JsBeforeUser> jsBeforeUsers = mapper.selectNoUserBefore(account, nickName, createDate,limit,page);
        return jsBeforeUsers;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/2/9
     * @Content:计算非进思用户数量
     */
    public List<JsBeforeUser> countNoUserBefore(String account,String nickName,String createDate){
        List<JsBeforeUser> jsBeforeUsers = mapper.countNoUserBefore(account, nickName, createDate);
        return jsBeforeUsers;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/22
     * @Content:查看非进思用户信息详情
     */
    public JsBeforeUser selectNoJsBeforeUserById(Integer userId){
        JsBeforeUser jsBeforeUser = mapper.selectNoJsBeforeUserById(userId);
        return jsBeforeUser;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/22
     * @Content:向封停列表中添加数据
     */
    public Boolean insertUserClosure(JsClosure jsClosure){
        Boolean insertBoolean = mapper.insertUserClosure(jsClosure);
        return insertBoolean;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/22
     * @Content:更改账号状态
     */
    public Boolean updateUserStatus(Integer id,Integer status){
        Boolean updateaBoolean = mapper.updateUserStatus(id, status);
        return updateaBoolean;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/23
     * @Content:零消费用户列表
     */
    public List<JsBeforeUser> selectZeroUser(String account,String nickName,String createDate,Integer limit,Integer page){
        page = (page-1)*limit;
        List<JsBeforeUser> jsBeforeUsers = mapper.selectZeroUser(account, nickName, createDate, limit, page);
        return jsBeforeUsers;
    };

    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/1/23
     * @Content:零消费用户列表总数
     */
    public Integer countZeroUser(String account,String nickName,String createDate){
        Integer integer = mapper.countZeroUser(account, nickName, createDate);
        return integer;
    };
    /**
     * @Description:
     * @Author: XJR
     * @Date: 2022/2/16
     * @Content:通过id查看零消费用户详细信息
     */
    public JsBeforeUser selectZoreUserById(Integer userId){
        JsBeforeUser jsBeforeUser = mapper.selectZoreUserById(userId);
        return jsBeforeUser;
    };
}
